<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
    <head>
        <meta http-equiv="content-type" content="text/html;charset=utf-8" />
        <link rel="stylesheet" href="/mymedia/css/style.css" type="text/css" />
        <title>{% block title %}FanME{% endblock %}</title>
        <script language="javascript" src="/mymedia/js/jquery-1.6.2.min.js"></script>
        {% block mystylesheet %}{% endblock %}
        {% block myjavascript %}{% endblock %}
    </head>
    <body {% block bodystuff %}{% endblock%}>
        <!-- Begin Conteiner -->
        <div class='conteiner'>
            <!-- Begin Header -->
            <div class='header'>
                {% if user.is_authenticated %}
                    <div class="header-logo">
                        <a href="/dash/dashboard/"><img src="/mymedia/images/logo.png" alt="Logo" /></a>
                    </div>
                {% else %}
                    <div class="header-logo">
                        <a href="/"><img src="/mymedia/images/logo.png" alt="Logo" /></a>
                    </div>
                {% endif %}
                {% block header %}
                    {% block menuArea %}
                        <div class="header-menu-area">
                            {% block searchBox %}{% endblock searchBox %}
                            {% if user.is_authenticated %}
                                {% block menuOptions %}
                                    <ul class="menu-options">
                                        <li class="menu-item"><a href="/dash/dashboard/">Dashboard</a></li>
                                        <li class="menu-item"><a href="/dash/logbook/">Logbook</a></li>
                                        <li class="menu-item"><a href="/dash/topicos/">Topicos</a></li>
                                    </ul>
                                {% endblock menuOptions %}
                                <div class="logged-user">
                                    <div class="logged-user-name">
                                        {% if user.persona %}
                                            <a href="/dash/edit_account/">{{ user.first_name }}</a>
                                        {% else %}
                                            {{ user.empresa.razon_social }}
                                        {% endif%}
                                    </div>
                                    <div class="logged-user-menu">
                                        <a href='/accounts/logout/'>Salir</a>
                                    </div>
                                    <div class="logged-user-photo">
                                        {% if user.persona.avatar %}
                                            <img src="{{ user.persona.avatar.url_50x50 }}" alt="Logo" />
                                        {% else %}
                                            {% if user.persona %}
                                                {% if user.persona.sexo == "M" %}
                                                    <img src="/mymedia/images/avatar-male.png" alt="Logo" />
                                                {% else %}
                                                    <img src="/mymedia/images/avatar-famale.png" alt="Logo" />
                                                {% endif%}
                                            {% else %}
                                                    <img src="/mymedia/images/020.png" alt="Logo" />
                                            {% endif%}
                                        {% endif %}
                                    </div>
                                </div>
                            {% else %}
                                {% block header_login %}
                                    <div class="header-login-form">
                                        <form action="/accounts/login/" method="post">{% csrf_token %}
                                            <ul>
                                                {{ form_login.as_ul }}
                                            </ul>
                                            <input type="submit" value="Ingresar" class="submit"/>
                                        </form>
                                    </div>
                                {% endblock header_login %}
                            {% endif %}
                        </div>
                    {% endblock menuArea %}
                {% endblock header%}
                <div class="clear"></div>
            <!-- End Header -->
            </div>
            <!-- Begin Content -->
            <div class='content'>
                {% block content %}{% endblock%}
            <div class="clear"></div>
            <!-- End Content -->
            </div>
            <!-- Begin Footer -->
            <div class='footer'>
                {% block footer %}
                    <div class="footer-line-divisor">
                        <img src="/mymedia/images/footer-line-divisor.png" alt="Footer Line Divisor" />
                    </div>
                    <!-- Eso deberia ser dinamico -->
                    <div class="footer-links">
                        <a href="/dash/preguntas_mas_frecuentes/">Ayuda</a> |
                        <a href="#">Sobre Nosotros</a> |
                        <a href="#">Condiciones</a> |
                        <a href="#">Copyright</a>
                    </div>
                {% endblock%}
                <div class="clear"></div>
            <!-- End Footer -->
            </div>
            <div class="clear"></div>
        <!-- End Conteiner -->
        </div>
        <div class="clear"></div>
    </body>
</html>
